import 'package:chop/common/SPUtils.dart';
import 'package:chop/common/StringUtils.dart';
import 'package:chop/view/login/login.dart';
import 'package:chop/widgets/TextSizeWidget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'do_job/Buying.dart';

//构建帮我买item
Widget getBuyingItem(TextEditingController _contrller) {
  return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(17),

        ///圆角
        border: Border.all(color: Colors.white, width: 1),

        ///边框颜色、宽
        color: Colors.white,
      ),
      padding: EdgeInsets.all(10),
      child: Column(
        children: <Widget>[
          Container(
            width: double.infinity,
            padding: EdgeInsets.fromLTRB(25, 55, 10, 0),
            alignment: Alignment.bottomLeft,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Column(
                  children: <Widget>[
                    Row(
                      children: <Widget>[
                        FixedSizeText(
                          "● 选择商品:",
                          textAlign: TextAlign.left,
                          style: TextStyle(
                              color: Colors.black,
                              fontSize: ScreenUtil().setSp(36),
                              height: 1,
                              fontWeight: FontWeight.w800),
                        )
                      ],
                    ),
                    TextField(
                      controller: _contrller,
                      cursorWidth: 10,
                      decoration: InputDecoration(
                          hintText: "请点击输入购买的商品", border: InputBorder.none),
                      readOnly: true,
                      style: TextStyle(fontSize: ScreenUtil().setSp(25)),
                      onTap: () async{
                        String phone = await SPUtils.get("phone");
                        if(StringUtils.isNull(phone)) {
                          Get.to(LoginPage());
                        }else{
                          Get.to(Buying_job());
                          print("请点击了选择输入购买商品");
                        }
                      },
                    ),
                  ],
                ),
              ],
            ),
          ),
        ],
      ));
}
